<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>麦知网——学问有余，可为人师</title>

<!-- Bootstrap core CSS -->
<link href="../../css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../../css/non-responsive.css" rel="stylesheet">
<link href="../../css/font-awesome.min.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
<link href="../../css/manageCourse.css" rel="stylesheet">    
<link href="../../css/sco.message.css" rel="stylesheet">
<link href="../../css/scojs.css" rel="stylesheet">  
<script src="../../js/jquery.min.js"></script>
</head>
<body>
	{% include 'public/common/header.html' %}
<div class="container" style="margin-top:45px">
		<div class="row">
			<div class="col-xs-12">
				<div>
					<div class="tab_left pull-left">
						<ul class="nav nav-tabs">
						  <li class="active"><a href="#purchase" data-toggle="tab">已购买</a></li>
						  <li><a href="#collect" data-toggle="tab">收藏</a></li>
						  {% ifequal auth 1 %}
						  <li><a href="#publish" data-toggle="tab">发布</a></li>
						  {% endifequal %}
						  <li><a href="#business" data-toggle="tab">交易中</a></li>
						</ul>
					</div>
					
					<div class="clearfix"></div>
				</div>
<!-- Tab panes -->
				<div class="tab-content">
<!-- 已购买 标签第一签 -->
					<div class="tab-pane active" id="purchase">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="th1">课程名</th>
									<th class="th2">价格</th>
									<th class="th3">状态</th>
									<th class="th4">讲师</th>
									<th class="th5">操作</th>
								</tr>
							</thead>
							<tbody>
<!-- 已购买的课程 一条课程循环开始处 -->
							{% for i in purchase %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{i.1}}/{{i.2}}" width="50px" text-align="absmiddle"/></div>
										<div class="td_12 pull-left"><a href="{% url 'courses:thecourse' i.3 %}" title="{{i.0}}">{{i.0}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text">￥{{i.7}}</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text">{{i.5}}</div></td>
									<td>
										<div class="td_text">
											<span class="td_a"><a class="introduce" href="#" data-toggle="popover" data-placement="bottom" data-content="<div>交易对象：{{i.5}}<a href='javascript:void(0)' data-toggle='modal' data-target='#myModal{{i.3}}' title='向{{i.6}}发私信' class='intro_mes' ><span class='glyphicon glyphicon-envelope'></span></a></div><div>订单生成时间：{{i.4|date:'Y-m-d H:i:s'}}</div><div class='intro_btn'></div>" data-original-title title>订单详情</a></span>
											<span class="td_a"><a href="{% url 'courses:thecourse' i.3 %}">查看</a></span>
											<span class="td_a"><a href="javascript:void(0)" onclick="abort({{i.3}},1)">删除</a></span>
											
									<div class="modal fade" id="myModal{{i.3}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									  <div class="modal-dialog">
									    <div class="modal-content">
									      <div class="modal-header">
									        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									        <h4 class="modal-title">发送私信给{{i.5}}</h4>
									      </div>
									      <div class="modal-body">
									        <textarea class="form-control" id="message{{i.3}}" style="height:120px"></textarea>
									      </div>
									      <div class="modal-footer">
									      	<span id='messageresult{{i.3}}'></span>
									        <button type="button" onclick="connected({{i.3}})" class="btn btn-primary">发送</button>
									      </div>
									    </div><!-- /.modal-content -->
									  </div><!-- /.modal-dialog -->
									</div><!-- /.modal -->
<!-- 未评价的时候显示 开始-->
										{% ifequal i.8 0 %}
											<span class="td_a"><a class="score" href="#" data-toggle="popover" data-placement="bottom" data-content="<div>课程打分：<span class='rating'><span class='star' onclick='star(5);' style='width:20px;'>☆</span><span class='star' onclick='star(4);' style='width:20px;'>☆</span><span class='star' onclick='star(3);' style='width:20px;'>☆</span><span class='star' onclick='star(2);' style='width:20px;'>☆</span><span class='star' onclick='star(1);' style='width:20px;'>☆</span></span></div><div><span class='score_text1'>课程评价：</span><textarea class='score_text'></textarea></div><div class='intro_btn'><button type='button' class='btn btn-warning btn-xs'>确认收货</button></div>" data-original-title title>评价</a></span>
										{% endifequal %}
<!-- 未评价的时候显示 结束-->
<!-- 已评价的时候显示 开始-->
										{% ifequal i.8 1 %}
											<span class="td_a">已评价</span>
										{% endifequal %}
<!-- 已评价的时候显示 结束-->
										</div>
									</td>
								</tr>
							{% endfor %}
<!-- 已购买的课程 一条课程循环结束处 -->
<!-- !!!!!!!!REWARD!!!!!!!! -->
<!-- 已购买的课程 一条课程循环开始处 -->
							{% for i in reward %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{i.1}}/{{i.2}}" width="50px" text-align="absmiddle"/></div>
										<div class="td_12 pull-left"><a href="{% url 'rewards:thereward' i.8 %}" title="{{i.0}}">{{i.0}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text">悬赏</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text">{{i.5}}</div></td>
									<td>
										<div class="td_text">
											<span class="td_a"><a class="introduce" href="#" data-toggle="popover" data-placement="bottom" data-content="<div>交易对象：{{i.5}}<a href='' class='intro_mes' title='私信他'><span class='glyphicon glyphicon-envelope'></span></a></div><div>课程密码：{{i.7}}</div><div>订单生成时间：{{i.4|date:'Y-m-d H:i:s'}}</div><div class='intro_btn'><button type='button' class='btn btn-warning btn-xs'>确认收货</button></div>" data-original-title title>订单详情</a></span>
											<span class="td_a"><a href="{% url 'rewards:thereward' i.8 %}">查看</a></span>
										</div>
									</td>
								</tr>
							{% endfor %}
<!-- 已购买的课程 一条课程循环结束处 -->
							</tbody>
						</table>
					</div>
<!-- 收藏 标签第二签 -->
					<div class="tab-pane" id="collect">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="th1">课程名</th>
									<th class="th2">价格</th>
									<th class="th3">状态</th>
									<th class="th4">讲师</th>
									<th class="th5">操作</th>
								</tr>
							</thead>
							<tbody>
<!-- 收藏的课程 一条课程循环开始处 -->
							{% for k in follow %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{k.1}}/{{k.2}}" width="50px" text-align="absmiddle"/></div>
										<div class="td_12 pull-left"><a href="{% url 'courses:thecourse' k.3 %}" title="{{k.0}}">{{k.0}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text">￥{{k.6}}</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text">{{k.4}}</div></td>
									<td>
										<div class="collect_td_text">
											{% ifequal k.7 0 %}
											<div class="td_a pull-left"><a href="{% url 'courses:purchase' k.3 %}" type="button" class="btn btn-warning">立即购买</a></div>
											{% endifequal %}
											<div class="collect_td_a pull-left"><a href="javascript:void(0)" onclick="abort({{k.3}},2)">取消收藏</a></div>
											<div class="clearfix"></div>
										</div>
									</td>
								</tr>
							{% endfor %}
<!-- 收藏的课程 一条课程循环结束处 -->
							</tbody>
						</table>
					</div>
<!-- 发布 标签第三签 -->
					<div class="tab-pane" id="publish">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="tth1">课程名</th>
									<th class="tth2">价格</th>
									<th class="tth3">状态</th>
									<th class="tth4">销量</th>
									<th class="tth5">到期时间</th>
									<th class="tth6">操作</th>
								</tr>
							</thead>
							<tbody>
<!-- 发布的课程 一条课程循环开始处 -->
							{% for j in course %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{j.3}}/{{j.4}}" width="50px" text-align="absmiddle"/></div>
										<div class="ttd_12 pull-left"><a href="{% url 'courses:thecourse' j.1 %}" title="{{j.2}}">{{j.2}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text" id="changePrice{{j.1}}">￥{{j.5}}</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text">{{j.6}}</div></td>
									<td><div class="td_text">{{j.7|date:'Y-m-d H:i:s'}}</div></td>
									<td>
<!-- 发布的 普通课程 开始-->
										<div id="control{{j.1}}" class="td_text">
											<span class="td_a"><a href="{% url 'courses:thecourse' j.1 %}"  target="_parent">查看</a></span>
											{% ifequal j.0 1 %}
											<span class="td_a"><a href="javascript:void(0)"  id="expired{{j.1}}" onclick='expired({{j.1}})'>延期</a></span>
											{% endifequal %}
											<span class="td_a"><a href="javascript:void(0)" onclick="changePrice({{j.1}},{{j.0}});">更改价格</a></span>
										</div>
<!-- 发布的 普通课程 结束-->
									</td>
								</tr>
							{% endfor %}
<!-- 发布的课程 一条课程循环结束处 -->

<!-- 发布的课程 一条课程循环开始处 -->
							{% for h in publish %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{h.3}}/{{h.4}}" width="50px" text-align="absmiddle"/></div>
										<div class="ttd_12 pull-left"><a href="/courses/types/tiny/course/lession/{{h.1}}?method=1" title="{{h.2}}">{{h.2}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text" id="changePrice{{h.1}}">￥{{h.5}}</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text"></div></td>
									<td><div class="td_text">{{h.6|date:'Y-m-d H:i:s'}}</div></td>
									<td>
<!-- 发布的 普通课程 开始-->
										<div id="control{{h.1}}" class="td_text">
											<span class="td_a"><a href="/courses/types/tiny/course/lession/{{h.1}}?method=1"  target="_parent">查看</a></span>
											{% ifequal h.0 1 %}
											<span class="td_a"><a href="javascript:void(0)" id="expired{{h.1}}" onclick='expired({{h.1}})'>延期</a></span>
											{% endifequal %}
											<span class="td_a"><a href="javascript:void(0)" onclick="changePrice({{h.1}},{{h.0}});">更改价格</a></span>
										</div>
<!-- 发布的 普通课程 结束-->
<!-- 揭榜 的课程 开始 -->
										<div class="td_text">
											<span class="td_a"><a href=""  target="_parent">编辑</a></span>
											<span class="td_a"><a href="">私信</a></span>
											<span class="td_a"><a id="changePsw" href="#" data-toggle="popover" data-placement="bottom" data-content="<div>原密码：23233</div><div>新密码：<input type='text'></div><div class='intro_btn'><button type='button' class='btn btn-warning btn-xs'>修改密码</button></div>" data-original-title title>修改密码</a></span>
											<span class="td_a"><a class="introduce2" href="#" data-toggle="popover" data-placement="bottom" data-content="<div>交易对象：孙芃芸<a href='' class='intro_mes' title='私信他'><span class='glyphicon glyphicon-envelope'></span></a></div><div>课程密码：1243</div><div>订单生成时间：2014-5-21 12:12:12</div><div class='intro_btn'><button type='button' class='btn btn-warning btn-xs'>确认收货</button></div>" data-original-title title>订单详情</a></span>
											<span><span class="jie"><b>揭</b></span></span>
										</div>
<!-- 揭榜 的课程 结束 -->
									</td>
								</tr>
							{% endfor %}
<!-- 发布的课程 一条课程循环结束处 -->
							</tbody>
						</table>
					</div>
<!-- 交易中的悬赏 标签 第四签 -->
					<div class="tab-pane" id="business">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="th1">课程名</th>
									<th class="th2">价格</th>
									<th class="th3">状态</th>
									<th class="th4">交易对象</th>
									<th class="th5">操作</th>
								</tr>
							</thead>
							<tbody>
<!-- 交易中的课程 一条课程循环开始处 -->
							{% for g in ing %}
								<tr>
									<td class="td1">
										<div class="pull-left"><img src="{{g.2}}/{{g.3}}" width="50px" text-align="absmiddle"/></div>
										<div class="td_12 pull-left"><a href="/courses/types/tiny/course/lession/{{g.7}}?method=1" title="{{g.4}}">{{g.4}}</a></div>
										<div class="clearfix"></div>
									</td>
									<td><div class="td_text">￥{{g.5}}</div></td>
									<td><div class="td_text">成功</div></td>
									<td><div class="td_text">{{g.6}}<a href='javascript:void(0)' data-toggle='modal' data-target='yourModal{{g.7}}' title='向{{g.6}}发私信'> <span class='glyphicon glyphicon-envelope'></span></a></div></td>
									<div class="modal fade" id="yourModal{{g.7}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									  <div class="modal-dialog">
									    <div class="modal-content">
									      <div class="modal-header">
									        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									        <h4 class="modal-title">发送私信给{{g.6}}</h4>
									      </div>
									      <div class="modal-body">
									        <textarea class="form-control" id="message{{g.7}}" style="height:120px"></textarea>
									      </div>
									      <div class="modal-footer">
									      	<span id='messageresult{{g.7}}'></span>
									        <button type="button" onclick="connected({{g.7}})" class="btn btn-primary">发送</button>
									      </div>
									    </div><!-- /.modal-content -->
									  </div><!-- /.modal-dialog -->
									</div><!-- /.modal -->
									<td>
										<div class="td_text">
											<span class="td_a"><a href="javascript:void(0)">取消订单</a></span>
											<span class="td_a"><a class="introduce" href="javascript:void(0)" data-toggle="popover" data-placement="bottom" data-content="<div>交易对象：{{g.6}} </div><div>课程密码：{{g.8}}</div><div>订单生成时间：{{g.9|date:'Y-m-d H:i:s'}}</div><div class='intro_btn'></div>" data-original-title title>订单详情</a></span>
<!-- 只有揭榜者 有   -->											
										{% ifequal g.1 1 %}
											<span><span class="jie"><b>揭</b></span></span>
										{% endifequal %}
<!-- 只有发布悬赏者 有   -->	
										{% ifequal g.0 1 %}
											<span><span class="fa"><b>发</b></span></span>
										{% endifequal %}
										</div>
									</td>
								</tr>
							{% endfor %}
<!-- 交易中的课程 一条课程循环结束处 -->
							</tbody>
						</table>
					</div>
				</div>
				
			</div>
		</div>
</div>

{% if error %}
<div align="center">没有课程，<a href="{{ jump_url }}">点此</a>新建课程</div>
{% endif %}
	
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="../../js/bootstrap.js"></script>
	<script src="../../js/message.js"></script>
	<script src="../../js/logout.js"></script>
	<script src="../../js/sco.message.js"></script>
	<script src="../../js/manage.js"></script>
	<script type="text/javascript">
		$('.introduce').popover({html:true});
		$('.score').popover({html:true});
		$('.edit').popover({html:true});
		$('.introduce2').popover({html:true});
		$('.changePsw').popover({html:true});
		$('.introduce3').popover({html:true});
		
		function star(integ){
			alert(integ);
		}
		
		function changePrice(a,mark){
			$("#changePrice"+a).html("<input type='text' placeholder='这里写价格' id='alter"+a+"' style='width:80px;'>");
			$("#control"+a).html("<button type='button' onclick='alter("+a+","+mark+")' class='btn btn-default'>修改价格</button>");
		}
		
		
	</script>
</body>
</html>